 /*   
 * Project: OSMP
 * FileName: Device.java
 * version: V1.0
 */
package com.cnpc.iot.scene.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.cnpc.framework.annotation.Header;
import com.cnpc.framework.base.entity.BaseEntity;
import com.cnpc.framework.base.entity.Dict;

/**
 * Description:
 * @author: wangkaiping
 * @date: 2018年2月24日 上午11:00:57上午10:51:30
 */
@Entity
@Table(name = "tbl_sensor")
public class Sensor extends BaseEntity{
	
	@Header(name="所属设备")
	@Column(name="device_id")
	private String deviceId;
	
	@Header(name = "传感器")
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "type")
    private Dict type;
	
	@Header(name="IO口")
    @Column(name="io_port")
	private Integer ioPort;
	
	@Header(name="取值精度")
    @Column(name="livalue")
	private Integer livalue;
	
	@Header(name="单位")
    @Column(name="unit")
	private String unit;
	
	@Header(name="图标")
    @Column(name="icon")
	private String icon;
	
	@Header(name="备注")
    @Column(name="remark")
	private String remark;

	public String getDeviceId() {
		return deviceId;
	}

	public void setDeviceId(String deviceId) {
		this.deviceId = deviceId;
	}

	public Dict getType() {
		return type;
	}

	public void setType(Dict type) {
		this.type = type;
	}

	public Integer getIoPort() {
		return ioPort;
	}

	public void setIoPort(Integer ioPort) {
		this.ioPort = ioPort;
	}

	public Integer getLivalue() {
		return livalue;
	}

	public void setLivalue(Integer livalue) {
		this.livalue = livalue;
	}

	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
	
	
	
	public static void main(String[] args) {
		int count = 6;
		if(count >0) {
			for(int i=0; i<count; i++) {
				if(i %3 == 0 && i !=0) {
					System.out.println("---------end---------");
				}
				if(i %3 == 0) {
					System.out.println("---------start---------");
				}
				
				System.out.println(i);
				
			}
			System.out.println("---------end---------");
		}
		
	}
	
	
	
	
}
